﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Windows.Forms;

namespace det
{
    class Xuly
    {
        Chuoiketnoi connect = new Chuoiketnoi();
        public bool ktdangnhap(string user, string pass)
        {
            bool kt;
            string sql = "select * from NHAN_VIEN where MANV ='" + user +"' and PASSWORD ='" +pass+"'";
            try
            {
                connect.taoketnoi();
                if (connect.exc(sql) == true)
                {
                    return kt = true;
                }
                else
                {
                    return kt = false;
                }
                connect.dongketnoi();
            }
            catch
            {
                return kt  = false;
            }
        }
        
        public void Showform(Form A, Form B)
        {
            A.MdiParent = B;
            A.Show();
        }
    }
}
